package cn.iocoder.yudao.module.energy.controller.admin.statistics.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDate;
import java.util.List;
import java.util.Map;

@Schema(description = "管理后台 - 能源统计数据 Response VO")
@Data
public class StatisticsRespVO {

    @Schema(description = "设备总数")
    private Integer deviceCount;

    @Schema(description = "设备能耗总数（kWh）")
    private Double totalEnergy;

    @Schema(description = "今日预警数量")
    private Long todayAlertCount;

    @Schema(description = "总预警数量")
    private Long totalAlertCount;
    
    @Schema(description = "近7天每天各类型预警数量统计")
    private List<DailyAlertTypeCountVO> dailyAlertTypeCounts;
    
    @Schema(description = "近30天每天各类型预警数量统计")
    private List<DailyAlertTypeCountVO> monthlyDailyAlertTypeCounts;
    
    @Schema(description = "近一年每月各类型预警数量统计")
    private List<DailyAlertTypeCountVO> yearlyMonthlyAlertTypeCounts;
    
    @Schema(description = "近7天按告警级别和预警类型分组的预警数量统计")
    private List<AlertLevelTypeCountVO> dailyAlertLevelTypeCounts;
    
    @Schema(description = "近30天按告警级别和预警类型分组的预警数量统计")
    private List<AlertLevelTypeCountVO> monthlyAlertLevelTypeCounts;
    
    @Schema(description = "近一年按告警级别和预警类型分组的预警数量统计")
    private List<AlertLevelTypeCountVO> yearlyAlertLevelTypeCounts;
    
    @Schema(description = "按告警级别分组的全部预警数量统计")
    private Map<String, Long> alertLevelCounts;
    
    @Schema(description = "按告警级别和预警类型分组的全部预警数量统计")
    private Map<String, Map<String, Long>> alertLevelTypeCounts;
    
    @Schema(description = "告警级别为warning的各类型预警数量统计")
    private Map<String, Long> alertWarningLevelCounts;
    
    @Schema(description = "告警级别为danger的各类型预警数量统计")
    private Map<String, Long> alertDangerLevelCounts;
    
    @Data
    public static class DailyAlertTypeCountVO {
        
        @Schema(description = "日期")
        private LocalDate date;
        
        @Schema(description = "各类型预警数量")
        private Map<String, Long> alertTypeCounts;
    }
    
    @Data
    public static class AlertLevelTypeCountVO {
        
        @Schema(description = "日期")
        private LocalDate date;
        
        @Schema(description = "告警级别")
        private String level;
        
        @Schema(description = "各类型预警数量")
        private Map<String, Long> alertTypeCounts;
    }
} 